<?php

namespace App\Models\PartTime;

use Illuminate\Database\Eloquent\Model;

/**
 * 兼职工作报名记录Model
 * Class PartTimeSignUp
 * @package App\Models\PartTime
 */
class PartTimeSignUp extends Model
{
    //设置表的类型和表名
    protected $table = 'part_time_sign_up';
    protected $primaryKey = 'id';
    public $timestamps = true;
    protected $guarded = [];

    /**
     * 获取报名状态名称
     * @return string
     */
    public function getStatusNameAttribute()
    {
        switch ($this->status) {
            case '0':
                return '待处理';
                break;
            case '1':
                return '已查看';
                break;
            case '2':
                return '同意邀约';
                break;
            case '3':
                return '已被婉拒';
                break;
            case '4':
                return '已删除';
                break;
        }
    }

    /**
     * 获取简历信息
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function signUpResume(){
        return $this->hasOne('App\Models\PartTime\PartTimeResume','id','pt_resume_id');
    }

}